var websock = {
    webSock:null,
    sendMsg:function (msg,toWho,init,nickname,sex) {
        websock.webSock.send(JSON.stringify({data:msg,toWho:toWho,init:init,nickname:nickname,sex:sex}));
    },
    init:function (fun) {
        if ("WebSocket" in window) {
            websock.webSock = new WebSocket('ws://swoole.vovoqi.com:39999/');
        }else{
            // 浏览器不支持 WebSocket
            alert("您的浏览器不支持 WebSocket!");
        }
    }
}